From feea83809d3ea4f4641e29a57d56536ec6912743 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Tue, 29 Nov 2005 14:56:54 +0000 Subject: [PATCH] Added trap for ERR, to get better response from the scripts when they are really broken, and add do_or_die command. Signed-off-by: Ewan Mellor --- tools/examples/xen-hotplug-common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/examples/xen-hotplug-common.sh b/tools/examples/xen-hotplug-common.sh index 9cce5175a2..2d9fd9da04 100644 --- a/tools/examples/xen-hotplug-common.sh +++ b/tools/examples/xen-hotplug-common.sh @@ -40,6 +40,17 @@ success() { xenstore_write "$XENBUS_PATH"/hotplug-status connected } +do_or_die() { + "$@" || fatal "$@ failed" +} + +sigerr() { + fatal "$0" "$@" "failed; error detected." +} + +trap sigerr ERR + + ## # xenstore_read + # -- 2.30.2